import React, { useImperativeHandle } from 'react'

export default function Child(props) {
  // !#3
  const { cRef } = props
  const test = (v) => {
    // !#6
    console.log(v)
  }
  // !#4
  useImperativeHandle(cRef, () => ({
    // !#5
    xxx: (v) => {
      test(v)
    },
  }))
  return <div>Child</div>
}
